        <!DOCTYPE html>
        <html>
        <head>
                <meta charset="utf-8">
        <title>FailureHandler abstract class / matcher Library / Dart Documentation</title>
        <link rel="stylesheet" type="text/css"
            href="../styles.css">
        <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800" rel="stylesheet" type="text/css">
        <link rel="shortcut icon" href="../favicon.ico">
        
        </head>
        <body data-library="matcher" data-type="FailureHandler">
        <div class="page">
        <div class="header">
          <a href="../index.html"><div class="logo"></div></a>
          <a href="../index.html">Dart Documentation</a>
         &rsaquo; <a href="../matcher.html">matcher</a> &rsaquo; <a href="../matcher/FailureHandler.html">FailureHandler</a>        <div id="search-box">
          <input type="search" name="q" id="q" autocomplete="off"
              class="search-input" placeholder="Search API">
        </div>
        
      </div>
      <div class="drop-down" id="drop-down"></div>
      
        <div class="nav">
        
</div>
<div class="content">
        <h2><strong>FailureHandler</strong>
          abstract class
        </h2>
        
<button id="show-inherited" class="show-inherited">Hide inherited</button>
<div class="doc">
<p>Failed matches are reported using a default IFailureHandler.
The default implementation simply throws <a class="crossref" href="../matcher/TestFailure.html">TestFailure</a>s;
this can be replaced by some other implementation of
IFailureHandler by calling configureExpectHandler.</p>
<pre class="source">
abstract class FailureHandler {
 /** This handles failures given a textual decription */
 void fail(String reason);

 /**
  * This handles failures given the actual [value], the [matcher]
  * the [reason] (argument from [expect]), some additonal [matchState]
  * generated by the [matcher], and a verbose flag which controls in
  * some cases how much [matchState] information is used. It will use
  * these to create a detailed error message (typically by calling
  * an [ErrorFormatter]) and then call [fail] with this message.
  */
 void failMatch(actual, Matcher matcher, String reason,
                MatchState matchState, bool verbose);
}
</pre>
</div>
<h3>Subclasses</h3>
<p>
<span class="type-box"><span class="icon-class"></span><a href="../matcher/DefaultFailureHandler.html">DefaultFailureHandler</a></span></p>
<div>
<h3>Methods</h3>
<div class="method"><h4 id="fail">
abstract void <strong>fail</strong>(String reason) <a class="anchor-link" href="#fail"
              title="Permalink to FailureHandler.fail">#</a></h4>
<div class="doc">
<p>This handles failures given a textual decription </p>
</div>
</div>
<div class="method"><h4 id="failMatch">
abstract void <strong>failMatch</strong>(actual, <a href="../matcher/Matcher.html">Matcher</a> matcher, String reason, <a href="../matcher/MatchState.html">MatchState</a> matchState, bool verbose) <a class="anchor-link" href="#failMatch"
              title="Permalink to FailureHandler.failMatch">#</a></h4>
<div class="doc">
<p>This handles failures given the actual <code>value</code>, the 
<span class="param">matcher</span>
the 
<span class="param">reason</span> (argument from <a class="crossref" href="../matcher.html#expect">expect</a>), some additonal 
<span class="param">matchState</span>
generated by the 
<span class="param">matcher</span>, and a verbose flag which controls in
some cases how much 
<span class="param">matchState</span> information is used. It will use
these to create a detailed error message (typically by calling
an <a class="crossref" href="../matcher/ErrorFormatter.html">ErrorFormatter</a>) and then call <a class="crossref" href="../matcher/FailureHandler.html#fail">fail</a> with this message.</p>
</div>
</div>
</div>
        </div>
        <div class="clear"></div>
        </div>
        <div class="footer">
          
        </div>
        <script async src="../client-live-nav.js"></script>
        </body></html>
        
